package grpc

import (
	"context"
	srv "github.com/shinedone/srv-server/internal/modules/enterprise/srv"
)

type GrpcService struct {
	EnterpriseSrv *srv.EnterpriseSrv `inject:""`
}

func (e GrpcService) GetByEnterpriseId(ctx context.Context, req *GetByEnterpriseIdReq) (*GetByEnterpriseIdResp, error) {
	getByEnterpriseIdResult, err := e.EnterpriseSrv.GetByEnterpriseId(ctx, req.GetEnterpriseId())
	if err != nil {
		return nil, err
	}
	return &GetByEnterpriseIdResp{
		EnterpriseId: "dasd",
		Name:         getByEnterpriseIdResult,
	}, nil
}

func (e GrpcService) GetByEnterpriseId2(ctx context.Context, req *GetByEnterpriseIdReq) (*GetByEnterpriseIdResp, error) {
	return &GetByEnterpriseIdResp{
		EnterpriseId: "dasd",
		Name:         "dasd",
	}, nil
}
